<?php

include 'islogin.php';

include '../config.php';



if(isset($_GET['flag']))

{



	if($_GET['flag']=='del')

	{

		$sql = "delete from en_dealer where id=".$_GET['id'];

		mysql_query($sql);

	}

}

?>

<script src="../js/jquery-1.7.1.js"></script>

<link href="images/skin.css" rel="stylesheet" type="text/css" />

<link href="css/right.css" rel="stylesheet" type="text/css"/>

<script>

function mouseoverTD(obj)

{

	   $(obj).css("background","#aaa");

}

function mouseoutTD(obj)

{

	  $(obj).css("background","");

}



function del(id,obj)

{

	  if(confirm("是否要删除此条网点信息？"))

	  {

		  var url = "dealer_list.php?flag=del&id="+id;

		  

		  window.location.href=url;

	  }

	  

}

</script>





<div style="border:0px solid red;"> 



    	<div id="top"><div>经销网点</div></div>

    	

	    <div id="middle">

	    	<!-- 类型列表 -->

	      <div class="layout">

		       <div class="title">网点列表</div>

		       <div class="content">
                 <h1 style="font-size:14px; background-color: white;padding: 15px;color:red;">实体店</h1>
		       	 <table width="100%"  cellspacing="0" cellpadding="0">  

			   				<tr >

				   		   		<td class="title_some_td" style="width:200px; text-align:center;">名称</td>

				   		   		<td class="title_some_td" style="width:300px; text-align:center;">地区</td>

				   		   		<td class="title_some_td" style="width:100px; text-align:center;">联系人</td>

				   		   		<td class="title_some_td" style="width:100px; text-align:center;">操作</td>

				   		   </tr>

				   		   <?php 

				   		   		$sql = "select id,name,city,address,contact_name,path,remark from en_dealer where type = 1";

				   		   		$result = mysql_query($sql);

				   		   		

				   		   		while($row = mysql_fetch_array($result))

				   		   		{

				   		   	?>

				   		   		<tr style='cursor:pointer;'  onmouseover='mouseoverTD(this)' onmouseout='mouseoutTD(this)'>

				   		   			<td class="context_td" style="width:100px; text-align:center;"><?php echo $row['name'];?></td>

				   		   			<td class="context_td" style="width:100px; text-align:center;"><?php echo $row['city'].$row['address'];?></td>

				   		   			<td class="context_td" style="width:100px; text-align:center;"><?php echo $row['contact_name'];?></td>

				   		   			<td class="context_td" style="width:100px; text-align:center;">

				   		   			<a style='text-decoration:underline;' href='javascript:return false;' onclick="del('<?php echo $row['id']?>',this)">删除</a>

				   		   			<a style='text-decoration:underline;' href='dealer_add.php?flag=update&id=<?php echo $row['id']?>'>修改</a>

				   		   			</td>

				   		   		</tr>

				   		   	

				   		   	<?php

				   		   		}

				   		   ?>

				  </table>
				  <h1 style="font-size:14px; background-color: white;padding: 15px;color:red;">淘宝店</h1>
		  		  <table width="100%"  cellspacing="0" cellpadding="0">  

	   				<tr >

		   		   		<td class="title_some_td" style="width:200px; text-align:center;">名称</td>

		   		   		<td class="title_some_td" style="width:300px; text-align:center;">地区</td>

		   		   		<td class="title_some_td" style="width:100px; text-align:center;">店铺地址</td>

		   		   		<td class="title_some_td" style="width:100px; text-align:center;">操作</td>

		   		   </tr>
   	   			   <?php 

	   		   		$sql = "select id,name,city,address,shop_address,path,remark from en_dealer where type = 2";

	   		   		$result = mysql_query($sql);

	   		   		

	   		   		while($row = mysql_fetch_array($result))

	   		   		{

	   		     	?>

				   		   		<tr style='cursor:pointer;'  onmouseover='mouseoverTD(this)' onmouseout='mouseoutTD(this)'>

				   		   			<td class="context_td" style="width:100px; text-align:center;"><?php echo $row['name'];?></td>

				   		   			<td class="context_td" style="width:100px; text-align:center;"><?php echo $row['city'];?></td>

				   		   			<td class="context_td" style="width:100px; text-align:center;"><?php echo $row['shop_address'];?></td>

				   		   			<td class="context_td" style="width:100px; text-align:center;">

				   		   			<a style='text-decoration:underline;' href='javascript:return false;' onclick="del('<?php echo $row['id']?>',this)">删除</a>

				   		   			<a style='text-decoration:underline;' href='dealer_add.php?flag=update&id=<?php echo $row['id']?>'>修改</a>

				   		   			</td>

				   		   		</tr>

				   		   	

				   		   	<?php

				   		   		}

				   		   ?>
		   		   </table>

		       </div>

		  </div>

		 </div>

		 <div id="bottom"></div>

</div>		  